home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1996, 1997 Meta Four Software. All rights reserved.
- //
- // This file contains the declaration of the MFC replacement collections.
- //
- //! rev="$Id: m4coll.h,v 1.9 1997/06/06 15:08:25 jcw Rel $"
-
- #ifndef __M4COLL_H__
- #define __M4COLL_H__
-
- /////////////////////////////////////////////////////////////////////////////
- // Declarations in this file
-
- class c4_BaseArray;
- class c4_PtrArray;
-
- /////////////////////////////////////////////////////////////////////////////
-
- class c4_BaseArray
- {
- public:
- c4_BaseArray ();
- ~c4_BaseArray ();
-
- int GetLength() const;
- void SetLength(int nNewSize);
-
- const void* GetData(int nIndex) const;
- void* GetData(int nIndex);
-
- void Grow(int nIndex);
-
- void InsertAt(int nIndex, int nCount);
- void RemoveAt(int nIndex, int nCount);
-
- private:
- char* _data;
- int _size;
- };
-
- class c4_PtrArray
- {
- public:
- c4_PtrArray ();
- ~c4_PtrArray ();
-
- int GetSize() const;
- void SetSize(int nNewSize, int nGrowBy = -1);
-
- void* GetAt(int nIndex) const;
- void SetAt(int nIndex, void* newElement);
- void*& ElementAt(int nIndex);
-
- int Add(void* newElement);
-
- void InsertAt(int nIndex, void* newElement, int nCount = 1);
- void RemoveAt(int nIndex, int nCount = 1);
-
- private:
- static int Off(int n_);
-
- c4_BaseArray _base;
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- #if q4_INLINE
- #include "m4coll.inl"
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
-
- #endif
-